package com.xzz;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author 黄会准
 * @since 2020-11-18
 */
public class MapAndFlatMap {
    public static void main(String[] args) {
        List<String> words = Arrays.asList(new String[]{"Hello","World"});
        List<String> collect = words.stream().map(word -> word.split("")).flatMap(Arrays::stream).distinct().collect(Collectors.toList());
        System.out.println(collect);

    }
}
